package cn.com.djin.ssm.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * 
 * @author djin
 *  订单实体类
 */
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
public class Orders implements Serializable {

	private static final long serialVersionUID = 1L;
	
	//订单oid
	private Integer oid;
	//订单编号
	private String oname;
	//订单生成时间
	@JsonFormat(pattern="yyyy/MM/dd HH:mm:ss",timezone="GMT+8")
	private Date makeOrderDate;
	//支付订单时间
	@JsonFormat(pattern="yyyy/MM/dd",timezone="GMT+8")
	private Date payOrderDate;
	//确认收货时间
	@JsonFormat(pattern="yyyy/MM/dd",timezone="GMT+8")
	private Date getOrderDate;
	//评价时间
	@JsonFormat(pattern="yyyy/MM/dd",timezone="GMT+8")
	private Date evalauteOrderDate;
	//商品编号集
	private String gids;
	//每一件商品的数量
	private String cnums;
	//每一件car里的价格
	private String cprices;
	//订单总价
	private double oprice;
	//订单状态
	private Integer state;
	//商品评论状态
	private String geids;
	//用户对象
	private User user;
	//地址对象
	private Address address;
	//订单评价对象
	private OrdersEvalaute ordersEvalaute;
	//商品颜色对象
	private String gcids;
	//商品尺寸对象
	private String gsids;
	
	private String stateStr;
	
	private List<OrdersBean> ordersList;
	
	public Integer getState() {
		return state;
	}
	public void setState(Integer state) {
		this.state = state;
	}
	public String getCprices() {
		return cprices;
	}
	public void setCprices(String cprices) {
		this.cprices = cprices;
	}
	public Date getMakeOrderDate() {
		return makeOrderDate;
	}
	public void setMakeOrderDate(Date makeOrderDate) {
		this.makeOrderDate = makeOrderDate;
	}
	public Integer getOid() {
		return oid;
	}
	public void setOid(Integer oid) {
		this.oid = oid;
	}
	public String getOname() {
		return oname;
	}
	public void setOname(String oname) {
		this.oname = oname;
	}
	public String getGids() {
		return gids;
	}
	public void setGids(String gids) {
		this.gids = gids;
	}
	public String getCnums() {
		return cnums;
	}
	public void setCnums(String cnums) {
		this.cnums = cnums;
	}
	public double getOprice() {
		return oprice;
	}
	public void setOprice(double oprice) {
		this.oprice = oprice;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public Address getAddress() {
		return address;
	}
	public void setAddress(Address address) {
		this.address = address;
	}
	public OrdersEvalaute getOrdersEvalaute() {
		return ordersEvalaute;
	}
	public void setOrdersEvalaute(OrdersEvalaute ordersEvalaute) {
		this.ordersEvalaute = ordersEvalaute;
	}
	public Date getPayOrderDate() {
		return payOrderDate;
	}
	public void setPayOrderDate(Date payOrderDate) {
		this.payOrderDate = payOrderDate;
	}
	public Date getGetOrderDate() {
		return getOrderDate;
	}
	public void setGetOrderDate(Date getOrderDate) {
		this.getOrderDate = getOrderDate;
	}
	public Date getEvalauteOrderDate() {
		return evalauteOrderDate;
	}
	public void setEvalauteOrderDate(Date evalauteOrderDate) {
		this.evalauteOrderDate = evalauteOrderDate;
	}
	public String getGcids() {
		return gcids;
	}
	public String getGsids() {
		return gsids;
	}
	public void setGcids(String gcids) {
		this.gcids = gcids;
	}
	public void setGsids(String gsids) {
		this.gsids = gsids;
	}
	public String getGeids() {
		return geids;
	}
	public void setGeids(String geids) {
		this.geids = geids;
	}
	public List<OrdersBean> getOrdersList() {
		return ordersList;
	}
	public void setOrdersList(List<OrdersBean> ordersList) {
		this.ordersList = ordersList;
	}
	public String getStateStr() {
		if(this.state==1){
			this.stateStr = "待支付";
		}else if(this.state==2){
			this.stateStr = "待收货";
		}else if(this.state==3){
			this.stateStr = "待评价";
		}else{
			this.stateStr = "已评价";
		}
		return stateStr;
	}
	public void setStateStr(String stateStr) {
		this.stateStr = stateStr;
	}
	@Override
	public String toString() {
		return "Orders [oid=" + oid + ", oname=" + oname + ", makeOrderDate=" + makeOrderDate + ", payOrderDate="
				+ payOrderDate + ", getOrderDate=" + getOrderDate + ", evalauteOrderDate=" + evalauteOrderDate
				+ ", gids=" + gids + ", cnums=" + cnums + ", cprices=" + cprices + ", oprice=" + oprice + ", state="
				+ state + ", geids=" + geids + ", user=" + user + ", address=" + address + ", ordersEvalaute="
				+ ordersEvalaute + ", gcids=" + gcids + ", gsids=" + gsids + ", ordersList=" + ordersList + "]";
	}
	
}
